/*
 * p11178.cpp
 *
 *  Created on: 2013-6-3
 *      Author: zy
 */

#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;

const double eps = 1e-6;
int sig(double d)
{
	return fabs(d) < eps ? 0 : d < 0 ? -1 : 1;
}

struct Point
{
	double x, y;
	void read()
	{
		scanf("%lf%lf", &x, &y);
	}
	Point friend operator +(Point a, Point b)
	{
		Point t;
		t.x = a.x + b.x;
		t.y = a.y + b.y;
		return t;
	}
	Point friend operator -(Point a, Point b)
	{
		Point t;
		t.x = a.x - b.x;
		t.y = a.y - b.y;
		return t;
	}
};

Point rotate(Point p, double radian)
{
	double c = cos(radian);
	double s = sin(radian);
	Point t;
	t.x = p.x * c - p.y * s;
	t.y = p.y * c + p.x * s;
	return t;
}

double cross(Point o, Point a, Point b)
{
	return (a.x - o.x) * (b.y - o.y) - (b.x - o.x) * (a.y - o.y);
}

double dot(Point o, Point a, Point b)
{
	return (a.x - o.x) * (b.x - o.x) + (a.y - o.y) * (b.y - o.y);
	//return ans;
}

double sqr(double x)
{
	return x * x;
}
double dis(Point a, Point b)
{
	return sqrt(sqr(a.x - b.x) + sqr(a.y - b.y));
}

double Cos(Point o, Point a, Point b)
{
	 return dot(o, a, b) / dis(o, a) / dis(o, b);
}

Point segCross(Point a, Point b, Point c, Point d)
{
	double s1 = cross(a, b, c);
	double s2 = cross(a, b, d);
	Point p;
	p.x = (c.x * s2 - d.x * s1) / (s2 - s1);
	p.y = (c.y * s2 - d.y * s1) / (s2 - s1);
	return p;
}
Point getD(Point a, Point b, Point c)
{
	double tt = Cos(b, a, c);
	double ang = acos(tt);
	Point t1, t2, d;
	t1 = rotate(c - b, ang / 3);
	t1 = t1 + b;

	ang = acos(Cos(c, a, b));
	t2 = rotate(b - c, -ang / 3);
	t2 = t2 + c;
	d = segCross(b, t1, c, t2);
	return d;
}
int main()
{
	int T;
	scanf("%d", &T);
	while (T--)
	{
		Point a, b, c, d, e, f;
		a.read();
		b.read();
		c.read();
		d = getD(a, b, c);
		e = getD(b, c, a);
		f = getD(c, a, b);

		printf("%0.6f %0.6f %0.6f %0.6f %0.6f %0.6f\n", d.x, d.y, e.x, e.y,
				f.x, f.y);
	}
	return 0;
}
